#include "ServerImp.h"

#include "Util.h"
#include "DefaultHandlerImp.h"

namespace frame {
namespace imp {

ServerImp::ServerImp(const int port) 
: port(port)
, handler(nullptr)
, channelNumber(new UniqueNumber)
{
}
ServerImp::~ServerImp(){
    if(channelNumber != nullptr)
        delete channelNumber;
}

int ServerImp::start() {
    if(handler == nullptr){
        setHandler(DefaultHandlerImp::instance());
    }
    return 0;
}

} //end of namespace  imp
} //end of namespace  frame
